package com.css.dzj.dzjap.modules.construnit.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Date;
import java.util.Objects;

/**
 * 建设单位实体类
 * @author liyunyue
 */
@Entity
@SQLDelete(sql = "update CONSTRUCTION_UNIT set DEL_FLAG = 1 where id = ?")
@Table(name = "CONSTRUCTION_UNIT", schema = "DZJAP", catalog = "")
public class ConstructionUnitEntity {
    private String id;
    private String entName;
    private String uniscid;
    private String location;
    private String detailedAddr;
    private String postalCode;
    private String legalPerson;
    private Date establishTime;
    private String linkMan;
    private String linkTel;
    private String email;
    private String businessLicense;
    private String attach;
    private String entType;
    private Date createTime;
    private String createPerson;
    private String updatePerson;
    private String bgTel;
    private String delFlag;
    private Date udateTime;
    private String password;
    private String userName;

    @Id
  /*  @GeneratedValue(generator = "idGenerator")
    @GenericGenerator(name = "idGenerator", strategy = "com.css.dzj.dzjap.common.util.SnowflakeId")*/
    @Column(name = "ID")
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "ENT_NAME")
    public String getEntName() {
        return entName;
    }

    public void setEntName(String entName) {
        this.entName = entName;
    }

    @Basic
    @Column(name = "UNISCID")
    public String getUniscid() {
        return uniscid;
    }

    public void setUniscid(String uniscid) {
        this.uniscid = uniscid;
    }

    @Basic
    @Column(name = "LOCATION")
    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    @Basic
    @Column(name = "DETAILED_ADDR")
    public String getDetailedAddr() {
        return detailedAddr;
    }

    public void setDetailedAddr(String detailedAddr) {
        this.detailedAddr = detailedAddr;
    }

    @Basic
    @Column(name = "POSTAL_CODE")
    public String getPostalCode() {
        return postalCode;
    }

    public void setPostalCode(String postalCode) {
        this.postalCode = postalCode;
    }

    @Basic
    @Column(name = "LEGAL_PERSON")
    public String getLegalPerson() {
        return legalPerson;
    }

    public void setLegalPerson(String legalPerson) {
        this.legalPerson = legalPerson;
    }

    @Basic
    @JsonFormat(shape= JsonFormat.Shape.STRING,pattern="yyyy-MM-dd",timezone="GMT+8")
    @Column(name = "ESTABLISH_TIME")
    public Date getEstablishTime() {
        return establishTime;
    }

    public void setEstablishTime(Date establishTime) {
        this.establishTime = establishTime;
    }

    @Basic
    @Column(name = "LINK_MAN")
    public String getLinkMan() {
        return linkMan;
    }

    public void setLinkMan(String linkMan) {
        this.linkMan = linkMan;
    }

    @Basic
    @Column(name = "LINK_TEL")
    public String getLinkTel() {
        return linkTel;
    }

    public void setLinkTel(String linkTel) {
        this.linkTel = linkTel;
    }

    @Basic
    @Column(name = "EMAIL")
    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Basic
    @Column(name = "BUSINESS_LICENSE")
    public String getBusinessLicense() {
        return businessLicense;
    }

    public void setBusinessLicense(String businessLicense) {
        this.businessLicense = businessLicense;
    }

    @Basic
    @Column(name = "ATTACH")
    public String getAttach() {
        return attach;
    }

    public void setAttach(String attach) {
        this.attach = attach;
    }

    @Basic
    @Column(name = "ENT_TYPE")
    public String getEntType() {
        return entType;
    }

    public void setEntType(String entType) {
        this.entType = entType;
    }

    @Basic
    @JsonFormat(shape= JsonFormat.Shape.STRING,pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @Column(name = "CREATE_TIME")
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "CREATE_PERSON")
    public String getCreatePerson() {
        return createPerson;
    }

    public void setCreatePerson(String createPerson) {
        this.createPerson = createPerson;
    }

    @Basic
    @Column(name = "UPDATE_PERSON")
    public String getUpdatePerson() {
        return updatePerson;
    }

    public void setUpdatePerson(String updatePerson) {
        this.updatePerson = updatePerson;
    }

    @Basic
    @Column(name = "BG_TEL")
    public String getBgTel() {
        return bgTel;
    }

    public void setBgTel(String bgTel) {
        this.bgTel = bgTel;
    }

    @Basic
    @Column(name = "DEL_FLAG")
    public String getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }

    @Basic
    @JsonFormat(shape= JsonFormat.Shape.STRING,pattern="yyyy-MM-dd",timezone="GMT+8")
    @Column(name = "UDATE_TIME")
    public Date getUdateTime() {
        return udateTime;
    }

    public void setUdateTime(Date udateTime) {
        this.udateTime = udateTime;
    }

    @Basic
    @Column(name = "PASSWORD")
    public String getPassword() {return password;}

    public void setPassword(String password) {this.password = password;}

    @Basic
    @Column(name = "USER_NAME")
    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {return true;}
        if (o == null || getClass() != o.getClass()) {return false;}
        ConstructionUnitEntity that = (ConstructionUnitEntity) o;
        return Objects.equals(id, that.id) &&
                Objects.equals(entName, that.entName) &&
                Objects.equals(uniscid, that.uniscid) &&
                Objects.equals(location, that.location) &&
                Objects.equals(detailedAddr, that.detailedAddr) &&
                Objects.equals(postalCode, that.postalCode) &&
                Objects.equals(legalPerson, that.legalPerson) &&
                Objects.equals(establishTime, that.establishTime) &&
                Objects.equals(linkMan, that.linkMan) &&
                Objects.equals(linkTel, that.linkTel) &&
                Objects.equals(email, that.email) &&
                Objects.equals(businessLicense, that.businessLicense) &&
                Objects.equals(attach, that.attach) &&
                Objects.equals(entType, that.entType) &&
                Objects.equals(createTime, that.createTime) &&
                Objects.equals(createPerson, that.createPerson) &&
                Objects.equals(updatePerson, that.updatePerson) &&
                Objects.equals(bgTel, that.bgTel) &&
                Objects.equals(delFlag, that.delFlag) &&
                Objects.equals(udateTime, that.udateTime) &&
                Objects.equals(password, that.password) &&
                Objects.equals(userName, that.userName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, entName, uniscid, location, detailedAddr, postalCode, legalPerson, establishTime, linkMan, linkTel, email, businessLicense, attach, entType, createTime, createPerson, updatePerson, bgTel, delFlag, udateTime, password, userName);
    }
}
